import type { IconValue } from '../../agStack/interfaces/iIcon';
import type { ValidationModuleName } from '../../interfaces/iModule';
import type { IconName } from '../../utils/icon';

export const ICON_VALUES: Record<IconValue, 1> = {
    expanded: 1,
    contracted: 1,
    'tree-closed': 1,
    'tree-open': 1,
    'tree-indeterminate': 1,
    pin: 1,
    'eye-slash': 1,
    arrows: 1,
    left: 1,
    right: 1,
    group: 1,
    aggregation: 1,
    pivot: 1,
    'not-allowed': 1,
    chart: 1,
    cross: 1,
    cancel: 1,
    tick: 1,
    first: 1,
    previous: 1,
    next: 1,
    last: 1,
    linked: 1,
    unlinked: 1,
    'color-picker': 1,
    loading: 1,
    menu: 1,
    'menu-alt': 1,
    filter: 1,
    'filter-add': 1,
    columns: 1,
    maximize: 1,
    minimize: 1,
    copy: 1,
    cut: 1,
    paste: 1,
    grip: 1,
    save: 1,
    csv: 1,
    excel: 1,
    'small-down': 1,
    'small-left': 1,
    'small-right': 1,
    'small-up': 1,
    asc: 1,
    desc: 1,
    aasc: 1,
    adesc: 1,
    none: 1,
    up: 1,
    down: 1,
    plus: 1,
    minus: 1,
    settings: 1,
    'checkbox-checked': 1,
    'checkbox-indeterminate': 1,
    'checkbox-unchecked': 1,
    'radio-button-on': 1,
    'radio-button-off': 1,
    eye: 1,
    'column-arrow': 1,
    'un-pin': 1,
    'pinned-top': 1,
    'pinned-bottom': 1,
    'chevron-up': 1,
    'chevron-down': 1,
    'chevron-left': 1,
    'chevron-right': 1,
    edit: 1,
};

export const ICON_MODULES: Record<IconName, ValidationModuleName | ValidationModuleName[]> = {
    chart: 'MenuCore',
    cancel: 'EnterpriseCore',
    first: 'Pagination',
    previous: 'Pagination',
    next: 'Pagination',
    last: 'Pagination',
    linked: 'IntegratedCharts',
    loadingMenuItems: 'MenuCore',
    unlinked: 'IntegratedCharts',
    menu: 'ColumnHeaderComp',
    legacyMenu: 'ColumnMenu',
    filter: 'ColumnFilter',
    filterActive: 'ColumnFilter',
    filterAdd: 'NewFiltersToolPanel',
    filterCardCollapse: 'NewFiltersToolPanel',
    filterCardExpand: 'NewFiltersToolPanel',
    filterCardEditing: 'NewFiltersToolPanel',
    filterTab: 'ColumnMenu',
    filtersToolPanel: 'FiltersToolPanel',
    columns: ['MenuCore'],
    columnsToolPanel: ['ColumnsToolPanel'],
    maximize: 'EnterpriseCore',
    minimize: 'EnterpriseCore',
    save: 'MenuCore',
    columnGroupOpened: 'ColumnGroupHeaderComp',
    columnGroupClosed: 'ColumnGroupHeaderComp',
    accordionOpen: 'EnterpriseCore',
    accordionClosed: 'EnterpriseCore',
    accordionIndeterminate: 'EnterpriseCore',
    columnSelectClosed: ['ColumnsToolPanel', 'ColumnMenu'],
    columnSelectOpen: ['ColumnsToolPanel', 'ColumnMenu'],
    columnSelectIndeterminate: ['ColumnsToolPanel', 'ColumnMenu'],
    columnMovePin: 'SharedDragAndDrop',
    columnMoveHide: 'SharedDragAndDrop',
    columnMoveMove: 'SharedDragAndDrop',
    columnMoveLeft: 'SharedDragAndDrop',
    columnMoveRight: 'SharedDragAndDrop',
    columnMoveGroup: 'SharedDragAndDrop',
    columnMoveValue: 'SharedDragAndDrop',
    columnMovePivot: 'SharedDragAndDrop',
    dropNotAllowed: 'SharedDragAndDrop',
    ensureColumnVisible: ['ColumnsToolPanel', 'ColumnMenu'],
    groupContracted: 'GroupCellRenderer',
    groupExpanded: 'GroupCellRenderer',
    setFilterGroupClosed: 'SetFilter',
    setFilterGroupOpen: 'SetFilter',
    setFilterGroupIndeterminate: 'SetFilter',
    setFilterLoading: 'SetFilter',
    close: 'EnterpriseCore',
    check: 'MenuItem',
    colorPicker: 'CommunityCore',
    groupLoading: 'LoadingCellRenderer',
    overlayLoading: 'Overlay',
    overlayExporting: 'Overlay',
    menuAlt: 'ColumnHeaderComp',
    menuPin: 'MenuCore',
    menuValue: 'MenuCore',
    menuAddRowGroup: ['MenuCore', 'ColumnsToolPanel'],
    menuRemoveRowGroup: ['MenuCore', 'ColumnsToolPanel'],
    clipboardCopy: 'MenuCore',
    clipboardCut: 'MenuCore',
    clipboardPaste: 'MenuCore',
    pivotPanel: ['ColumnsToolPanel', 'RowGroupingPanel'],
    rowGroupPanel: ['ColumnsToolPanel', 'RowGroupingPanel'],
    valuePanel: 'ColumnsToolPanel',
    columnDrag: 'EnterpriseCore',
    rowDrag: ['RowDrag', 'DragAndDrop'],
    csvExport: 'MenuCore',
    excelExport: 'MenuCore',
    smallDown: 'CommunityCore',
    selectOpen: 'CommunityCore',
    richSelectOpen: 'RichSelect',
    richSelectRemove: 'RichSelect',
    richSelectLoading: 'RichSelect',
    smallLeft: 'CommunityCore',
    smallRight: 'CommunityCore',
    subMenuOpen: 'MenuItem',
    subMenuOpenRtl: 'MenuItem',
    panelDelimiter: 'RowGroupingPanel',
    panelDelimiterRtl: 'RowGroupingPanel',
    smallUp: 'CommunityCore',
    sortAscending: ['MenuCore', 'Sort'],
    sortDescending: ['MenuCore', 'Sort'],
    sortAbsoluteAscending: ['MenuCore', 'Sort'],
    sortAbsoluteDescending: ['MenuCore', 'Sort'],
    sortUnSort: ['MenuCore', 'Sort'],
    advancedFilterBuilder: 'AdvancedFilter',
    advancedFilterBuilderDrag: 'AdvancedFilter',
    advancedFilterBuilderInvalid: 'AdvancedFilter',
    advancedFilterBuilderMoveUp: 'AdvancedFilter',
    advancedFilterBuilderMoveDown: 'AdvancedFilter',
    advancedFilterBuilderAdd: 'AdvancedFilter',
    advancedFilterBuilderRemove: 'AdvancedFilter',
    advancedFilterBuilderSelectOpen: 'AdvancedFilter',
    chartsMenu: 'IntegratedCharts',
    chartsMenuEdit: 'IntegratedCharts',
    chartsMenuAdvancedSettings: 'IntegratedCharts',
    chartsMenuAdd: 'IntegratedCharts',
    chartsColorPicker: 'IntegratedCharts',
    chartsThemePrevious: 'IntegratedCharts',
    chartsThemeNext: 'IntegratedCharts',
    chartsDownload: 'IntegratedCharts',
    checkboxChecked: 'CommunityCore',
    checkboxIndeterminate: 'CommunityCore',
    checkboxUnchecked: 'CommunityCore',
    radioButtonOn: 'CommunityCore',
    radioButtonOff: 'CommunityCore',
    rowPin: 'PinnedRow',
    rowUnpin: 'PinnedRow',
    rowPinBottom: 'PinnedRow',
    rowPinTop: 'PinnedRow',
};

export const DEPRECATED_ICONS_V33: Set<IconName> = new Set([
    'colorPicker',
    'smallUp',
    'checkboxChecked',
    'checkboxIndeterminate',
    'checkboxUnchecked',
    'radioButtonOn',
    'radioButtonOff',
    'smallDown',
    'smallLeft',
    'smallRight',
]);
